package ex1;

public class Count {
	public static int count(int[] numbers) {
		int count=0; 	//block 1
		for(int i=0; i<numbers.length; i++) {	//block 2
			int x = numbers[i];					//block 3
			if( x < 0) {						//block 4
				if (x == -1 && i > 0 && numbers[i-1] == -1) {	//block 5
					break;										//end block 5
				}
			} else {
				count++;										//block6
			}
		}
		return count;	//block7
	}
}